package com.tdkj.model.bbs;

import java.sql.Timestamp;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * EjfFriend entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ejf_friend", catalog = "west")
public class EjfFriend implements java.io.Serializable {

	// Fields

	private EjfFriendId id;
	private EjfUser ejfUser;
	private String remark;
	private Timestamp createTime;

	// Constructors

	/** default constructor */
	public EjfFriend() {
	}

	/** minimal constructor */
	public EjfFriend(EjfFriendId id, EjfUser ejfUser) {
		this.id = id;
		this.ejfUser = ejfUser;
	}

	/** full constructor */
	public EjfFriend(EjfFriendId id, EjfUser ejfUser, String remark, Timestamp createTime) {
		this.id = id;
		this.ejfUser = ejfUser;
		this.remark = remark;
		this.createTime = createTime;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( { @AttributeOverride(name = "userId", column = @Column(name = "userID", nullable = false, length = 15)), @AttributeOverride(name = "friendId", column = @Column(name = "friendID", nullable = false, length = 15)) })
	public EjfFriendId getId() {
		return this.id;
	}

	public void setId(EjfFriendId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userID", nullable = false, insertable = false, updatable = false)
	public EjfUser getEjfUser() {
		return this.ejfUser;
	}

	public void setEjfUser(EjfUser ejfUser) {
		this.ejfUser = ejfUser;
	}

	@Column(name = "remark", length = 50)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

}